angular.module("myApp",["ui.router","angularCSS","home","shopping","surpermarket","me","third","fourth","fifth","sixth","seventh","eighth"])
.config(["$urlRouterProvider",function($urlRouterProvider){
	$urlRouterProvider.otherwise("/home");
}]).controller("MyController",function($rootScope,$scope){
	$rootScope.navigate = true;
	//购物车
	$rootScope.cartData = [];
	$('.ll1').click(function(){
		$('.ll1 p').attr('class',"photo-home1");
		$('.ll2 p').attr('class','photo-surpermarket');
		$('.ll3 p').attr('class','photo-shopping');
		$('.ll4 p').attr('class','photo-me');
	})
	$('.ll2').click(function(){
		$('.ll2 p').attr('class','photo-surpermarket1');
		$('.ll1 p').attr('class',"photo-home");
		$('.ll3 p').attr('class','photo-shopping');
		$('.ll4 p').attr('class','photo-me');
	})
	$('.ll3').click(function(){
		$('.ll3 p').attr('class','photo-shopping1');
		$('.ll4 p').attr('class','photo-me');
		$('.ll2 p').attr('class','photo-surpermarket');
		$('.ll1 p').attr('class',"photo-home");
	})
	$('.ll4').click(function(){
		$('.ll4 p').attr('class','photo-me1');
		$('.ll3 p').attr('class','photo-shopping');
		$('.ll2 p').attr('class','photo-surpermarket');
		$('.ll1 p').attr('class',"photo-home");
	})
	//总的产品数量
	$scope.zs=function(){
		var sum=0;
		for(var i=0;i<$rootScope.cartData.length;i++){
			sum+=($rootScope.cartData[i]['count']);					
		}
		return sum;	
	}
})